package com.smartleanx.module.hrm.eums.employee;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor
public enum EmployeeContractTypeEnum {

    FIXED_TERM(1, "固定期限劳动合同"),

    NO_FIXED_TERM(2, "无固定期限劳动合同"),

    TASK_CONTRACT(3, "以完成一定工作任务为期限的劳动合同"),

    INTERNSHIP_AGREEMENT(4, "实习协议"),

    LABOR_CONTRACT(5, "劳务合同"),

    REEMPLOYMENT_AGREEMENT(6, "返聘协议"),

    OTHER_LABOR_DISPATCH(7, "其他劳务派遣"),
    ;

    private final Integer type;

    private final String name;


    EmployeeContractTypeEnum(int type, String name) {
        this.type = type;
        this.name = name;
    }

    public Integer gettype() {
        return type;
    }

    public String getName() {
        return name;
    }

    /**
     * 根据code返回desc
     *
     * @param type 编号
     * @return 名称
     */
    public static String getName(Integer type) {
        for (EmployeeContractTypeEnum e : EmployeeContractTypeEnum.values()) {
            if (e.gettype().equals(type)) {
                return e.getName();
            }
        }
        return null;
    }
}
